package com.ms.oschina.fragment;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.LinearLayout;

import com.ms.oschina.R;
import com.ms.oschina.adapter.NewsAdapter;
import com.ms.oschina.base.BaseFragment;
import com.ms.oschina.ui.activity.HomeActivity;
import com.ms.oschina.util.LogUtils;
import com.ms.oschina.util.UiUtils;

public class LeftMenuFragment extends BaseFragment implements OnClickListener {
	private LinearLayout menuItemQuests;
	private LinearLayout menuItemOpensoft;
	private LinearLayout menuItemBlog;
	private LinearLayout menuItemGitapp;
	private LinearLayout menuItemRss;

	private void findViews(View view) {
		menuItemQuests = (LinearLayout) view
				.findViewById(R.id.menu_item_quests);
		menuItemOpensoft = (LinearLayout) view
				.findViewById(R.id.menu_item_opensoft);
		menuItemBlog = (LinearLayout) view.findViewById(R.id.menu_item_blog);
		menuItemGitapp = (LinearLayout) view
				.findViewById(R.id.menu_item_gitapp);
		menuItemRss = (LinearLayout) view.findViewById(R.id.menu_item_rss);
	}

	public int getLayoutId() {
		return R.layout.fragment_leftmenu;

	};

	@Override
	public void initView(View view) {
		findViews(view);
	}

	@Override
	protected void initData() {
		menuItemQuests.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// 关闭侧滑面板
		HomeActivity homeActivity = (HomeActivity) getActivity();

		NewInfoFragment fragment = new NewInfoFragment();
		homeActivity.replaceContent(fragment);
		homeActivity.closeDrawer();
	}

}
